

from django.db import models
# 通过类创建表


# 课程表
class ClassInfo(models.Model):
    """
    课程表
    """
    Cno = models.IntegerField(primary_key=True)  # 课程编号
    Cname = models.CharField(max_length=20)  # 课程名
    Cpno = models.CharField(max_length=5, blank=True, null=True)  #
    Ccredit = models.IntegerField()  #

    class Meta:
        db_table = 'tb_course'  # 自定义表名
        verbose_name = '课程'  # 这是一张用户表
        verbose_name_plural = verbose_name
